package com.epfresh.supplier.activity;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.epfresh.api.global.AppActivity;
import com.epfresh.supplier.R;

/**
 * Created by wzh on 16-7-25.
 */
public class ProductPaymentActivity extends AppActivity {


    TextView tv1;
    TextView tv2;

    ImageView iv1;
    ImageView iv2;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        setContentView(R.layout.activity_product_payment);
        tvBack.setVisibility(View.VISIBLE);

        ivBack.setVisibility(View.VISIBLE);
        toolbarTitle.setText("支付方式");

        rightbtn.setText("保存");


        tv1 = (TextView) findViewById(R.id.tv_1);
        tv2 = (TextView) findViewById(R.id.tv_2);


        iv1 = (ImageView) findViewById(R.id.iv_select);
        iv2 = (ImageView) findViewById(R.id.iv_select_2);

        changeStatus(1);

    }


    public void changeStatus(int type){

        if (type > 0 ){//预先支付
            tv1.setTextColor(Color.parseColor("#f14c2f"));
            tv2.setTextColor(Color.parseColor("#434343"));
            iv1.setVisibility(View.VISIBLE);
            iv2.setVisibility(View.GONE);
        }else {//货到付款
            tv2.setTextColor(Color.parseColor("#f14c2f"));
            tv1.setTextColor(Color.parseColor("#434343"));
            iv2.setVisibility(View.VISIBLE);
            iv1.setVisibility(View.GONE);
        }
    }

    @Override
    public void onRightClick() {
        finish();
    }

    @Override
    public void onClick(View view) {
        super.onClick(view);
        switch (view.getId()) {

            case R.id.ci_pick_time:

                break;

            case R.id.rightbtn:
                save();
                break;


        }
    }

    private void save() {


    }


}
